@extends('layouts.admin')
@section('title','图片修复')
@section('content')


    <div class="col-md-5">
        <p>服务器图片
        <img src={{$image->squareImage(400,400)}}>
        </p>
        <p>外链图片
        <img src={{$image->description}}>
        </p>
        <a class="btn-success btn btn-block" role="button" href={{'http://image.baidu.com/search/index?tn=baiduimage&word='.$image->description}}>搜索相同图片</a>
    </div>


    <div class="col-md-offset-2 col-md-5">
        <div class="well well-lg row">

            <h3>先保存图片到本地 在上去到服务器</h3>

            {!! Form::open(['url' => 'http://up.qiniu.com', 'method' => 'post', 'files' => true]) !!}
            <input name="token" type="hidden" id ="upToken" value={{$upToken}}>
            <input name="key" type="hidden" value={{$image->key}}>
            <div class="form-group">
                {!! Form::label('file', '请选择上传文件', [])!!}
                {!! Form::file('file') !!}
                <p class="help-block">支持所有文件类型建议jpg gif bmp png torrent 等文件</p>
            </div>
            {!!Form::submit('上传',['class'=>'btn btn-success'])!!}

            {!! Form::close() !!}
        </div>

        <div class="well  row">
            {!! Form::model($image, ['route' => ['image.update', $image], 'method' => 'put']) !!}
            <div class="form-group">
                {!! Form::label('description', '文字描述:认为图片不没有问题就应该白url地址 换成图片关键字', ['class' => 'control-label']) !!}
                {!! Form::text('description', null, ['class' => 'form-control']) !!}
            </div>
            {!! Form::submit('保存', ['class' => 'form-control button btn-sucess']) !!}

            {!! Form::close() !!}


        </div>
    </div>

@endsection

